import time
from celery import task
from django.core.mail import send_mail
from django.conf import settings

@task
def celery_sendmail(user):
    # 给注册邮箱发送激活信息
    msg = '<a href="http://127.0.0.1:8000/user/register_active/?id=%d">点击激活</a>' % user.id
    send_mail("注册激活", '', settings.EMAIL_FROM, [user.email, ], html_message=msg)